package com.chh.exam.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chh.exam.user.entity.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author chh
* @description 针对表【wj_user】的数据库操作Mapper
* @createDate 2025-01-05 23:24:50
* @Entity com.chh.exam.user.entity.User
*/
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from wj_user where username=#{username} || phone = #{username}")
    User getUserByName(String username);

    @Update("update wj_user set nickname=#{nickname} where id = #{userId}")
    void updateNickname(Integer userId, String nickname);

    @Update("update wj_user set password=#{password} where id = #{userId}")
    void updatePassword(int userId, String password);

    @Update("update wj_user set avatar=#{avatar} where id = #{userId}")
    void updateAvatar(int userId, String avatar);
}




